UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/qhmwzAEydSZToJZ+EGzn3kkpqlGDWtyirvS4HbjtLI=' 
WHERE 
  key_id = '5a086b266d0b318245ab4667e63e1eab9cc2f3a3c010dff3f82c8ec2f6fa49d2' 
  AND (
    token = '/qhmwzAEydSZToJZ+EGzn3kkpqlGDWtyirvS4HbjtLI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00046