UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xz0D42yNFfv3+Y07l0WlA1w0KevX05DAU6a5B4i7F4k=' 
WHERE 
  key_id = '126a94b9507922501760ed804f6daf36b5a43c74cf430a8b5dc2b3f529202bca' 
  AND (
    token = 'xz0D42yNFfv3+Y07l0WlA1w0KevX05DAU6a5B4i7F4k=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044