UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bz/YjB/ZBfsJn12BXaTr5SPLo06YiTDMVqoxhqwnV8c=' 
WHERE 
  key_id = '2b416492ae509993edaf2246184baae6d27f6e6892a540c599916d77fe7ff22a' 
  AND (
    token = 'bz/YjB/ZBfsJn12BXaTr5SPLo06YiTDMVqoxhqwnV8c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029