UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wi5cqrAP7rZ5eSJT4dwoFLLF3j/BMhY714mZbDNzu4o=' 
WHERE 
  key_id = '54255c27a8349a39ed30a0d31329367f21cf6f961229ed268ab257daad35feed' 
  AND (
    token = 'wi5cqrAP7rZ5eSJT4dwoFLLF3j/BMhY714mZbDNzu4o=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045