UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Mbec490M9cJveYZ7XffQNSbi6MdO/2VPyVw4S5OiO9w=' 
WHERE 
  key_id = 'a9cc71fddc87647aacc42496aa2aea53c4a70d64bf072cca41f90419bc652e5b' 
  AND (
    token = 'Mbec490M9cJveYZ7XffQNSbi6MdO/2VPyVw4S5OiO9w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047