UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Z2pLyAyQDMvA1xrmYlaPqfQwu8IGQhgwGpboklxWw1w=' 
WHERE 
  key_id = 'ef57cf654cbeb3b21d00ee0a9c067dacf3b5a2b284ad0dc4d949259838b67e01' 
  AND (
    token = 'Z2pLyAyQDMvA1xrmYlaPqfQwu8IGQhgwGpboklxWw1w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035