UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Rx0KEfj44aimAZfGHYvkroqqDH5Q1vprVDIE0bNJjIg=' 
WHERE 
  key_id = 'af28fb24ebc60a15950c22cc7510a0b90b3fc585e9d93869c889049e7fee1d44' 
  AND (
    token = 'Rx0KEfj44aimAZfGHYvkroqqDH5Q1vprVDIE0bNJjIg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029