UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '5cvhlJRTjzZbwMuMQBR58ALM//PKbUvRbj6jOVl6deM=' 
WHERE 
  key_id = '684ba2b386e0dd5f1c6123a1bc515dac33b28488fda40e15fd39585b22a3a5a4' 
  AND (
    token = '5cvhlJRTjzZbwMuMQBR58ALM//PKbUvRbj6jOVl6deM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033