UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vnIfEb/ECqCGdRzuIg6pXdpcrm3GgYe8Yu+nu/qmebI=' 
WHERE 
  key_id = '1959237051a1cf3b23c5869f3c7242c733e8c8c16737c32596ebd7d56dfffcf3' 
  AND (
    token = 'vnIfEb/ECqCGdRzuIg6pXdpcrm3GgYe8Yu+nu/qmebI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036