UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bNxwQUO9ijwo6DZyClJGo2z+xHM+woXcgPJIaCshHUA=' 
WHERE 
  key_id = '73e5c01ea9cc17ef71dfda2ee27af908e2bdb3cf0d5c73c121e800e77f91c152' 
  AND (
    token = 'bNxwQUO9ijwo6DZyClJGo2z+xHM+woXcgPJIaCshHUA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032