UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/VLdMugaekU2eMh5ZUo9ep5rPC+2C/i4Lk/3sPB4c68=' 
WHERE 
  key_id = 'c5f2446c324d2e141b9214e39b07435da4047911de4eb4b7a81f446f146c6396' 
  AND (
    token = '/VLdMugaekU2eMh5ZUo9ep5rPC+2C/i4Lk/3sPB4c68=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034