UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F07zyLY2A4Qs/pMpCRab0mjLhNkHbV+rwqGUx+eC9Gw=' 
WHERE 
  key_id = 'e6018686c04433273a3323bcba9a21e93995e5328d9477f249d556bd99bfac06' 
  AND (
    token = 'F07zyLY2A4Qs/pMpCRab0mjLhNkHbV+rwqGUx+eC9Gw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034