UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '22ZCJPsAl4/6YZvTT+qLSsVFJcT+LIb2G18OzGIOxmo=' 
WHERE 
  key_id = '7c5bae107b005cbadd1f746e310e55d8684b51a2bdcf032700a9f6a7a64a6b0d' 
  AND (
    token = '22ZCJPsAl4/6YZvTT+qLSsVFJcT+LIb2G18OzGIOxmo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027