UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PPCy02AtRh+vNnRYxFLWEGPmBDk4VFlhXwRqP75FBLc=' 
WHERE 
  key_id = 'f1038a51dec9ae4ce9d7b7becd9aa245970ad36974e70b0d9edbcae891c91bcf' 
  AND (
    token = 'PPCy02AtRh+vNnRYxFLWEGPmBDk4VFlhXwRqP75FBLc=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027