UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'dwLTGjdEgJ0CDdsSd0fDBCR/mT9P/AyYO8JGTV3oa/I=' 
WHERE 
  key_id = '7acfb50a6e3d94d65c418e4ba6e97c79883d1a3e7cdaf62d816be78c327f815d' 
  AND (
    token = 'dwLTGjdEgJ0CDdsSd0fDBCR/mT9P/AyYO8JGTV3oa/I=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023