UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '02a+L0TBj7w3XmjLv/MgmyrpD6zZG2fqveshVGcazg8=' 
WHERE 
  key_id = '012e7525ccab37d110419cb640395f743473607e0e2905a63f3ec59705c04803' 
  AND (
    token = '02a+L0TBj7w3XmjLv/MgmyrpD6zZG2fqveshVGcazg8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017