UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vwqZ1kDb6no4abc9rU+bsbwGQ9ZQewHt+fLkQJbmfTY=' 
WHERE 
  key_id = '2e53e957cb28ba03033ee5fcd6729dc7068552f820f32401524e6d89832ebeea' 
  AND (
    token = 'vwqZ1kDb6no4abc9rU+bsbwGQ9ZQewHt+fLkQJbmfTY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042