UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'h6L8AvGzuTdbz6i4ktmic009bRpa/QbNKebZG5yezMI=' 
WHERE 
  key_id = '897211940e84c58313cec218b8fb73475d66b96c4ef340d4b66bebff3a4fccc3' 
  AND (
    token = 'h6L8AvGzuTdbz6i4ktmic009bRpa/QbNKebZG5yezMI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00098