UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ptoJjAb8agZNGtBJSOLWPGeP1rfV/BFbUighGhRAYqQ=' 
WHERE 
  key_id = '411cdbba8e4b008cf6453f519ab8534c51d897e3643eb7af32dad009e4bf2e06' 
  AND (
    token = 'ptoJjAb8agZNGtBJSOLWPGeP1rfV/BFbUighGhRAYqQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022