UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2uV948JJkdLoCSd7LxUFL8zNEvxahyck1xpIph1S6r0=' 
WHERE 
  key_id = '77ff8b90f6e05856543c38d52fed98f8e025c98b8056e19466584ce0f8ee8fff' 
  AND (
    token = '2uV948JJkdLoCSd7LxUFL8zNEvxahyck1xpIph1S6r0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026