UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QvOqU2GhZCWTBwQBg9R3oCbh+0AMpz6NX680UJNF/Dk=' 
WHERE 
  key_id = '67f301f601e35d74d57ef57e7bf1d978ca4f09e89a351401ec5aa91cc3d20db5' 
  AND (
    token = 'QvOqU2GhZCWTBwQBg9R3oCbh+0AMpz6NX680UJNF/Dk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00027