UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GzEswANa+oxkk1yoOy7GG/r5mhP3qcckvpnjawqyQV0=' 
WHERE 
  key_id = '5b71efdaed7ea909470d31ebe7e3e6be4148a352e1cb5b499c867305c0f0bb72' 
  AND (
    token = 'GzEswANa+oxkk1yoOy7GG/r5mhP3qcckvpnjawqyQV0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031