UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'VZD0CrLsfHmnaSHr1LspmyaEvjCs4i8Oi0oz/ub6jjI=' 
WHERE 
  key_id = 'f879d9b0644dbb40ce8a78f4c226e98839caaa4b4775ad94c5e831d1db3dc9f1' 
  AND (
    token = 'VZD0CrLsfHmnaSHr1LspmyaEvjCs4i8Oi0oz/ub6jjI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027