UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '8E0lU31nCipUkW++9xNIAKxKLsyVuybonJCG/d/9Ag0=' 
WHERE 
  key_id = 'd94945489ec516a020ed624e8411ea7e1e1dcfbec3d487800ce95f4fcc6d3e40' 
  AND (
    token = '8E0lU31nCipUkW++9xNIAKxKLsyVuybonJCG/d/9Ag0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042