UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'DhfFigMhGxmwXjZp9bsMhL3VMB4iev+m53HuIk5D9Oo=' 
WHERE 
  key_id = '2ff87de1e2835620c6b474ffc6a4d66ddd0e2432784c9f407ea45f96122fd2d7' 
  AND (
    token = 'DhfFigMhGxmwXjZp9bsMhL3VMB4iev+m53HuIk5D9Oo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022