UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UM0CqJt8/JOnS8NuYQArkVuhxUsqn1Xu+02MnefPcEs=' 
WHERE 
  key_id = '1907984b5aa0ac98d3d5c670106baa1f79afb73c9eee0cbcd074249730bc7504' 
  AND (
    token = 'UM0CqJt8/JOnS8NuYQArkVuhxUsqn1Xu+02MnefPcEs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00034