UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+PkkXctdWXB008ClKkzxGXCK9sTk/K/grqQxKS4iX9g=' 
WHERE 
  key_id = '81b00422ddaf54e20c7e88c8c46eed9da0d5ef042b130532fb775bfd13b1fa17' 
  AND (
    token = '+PkkXctdWXB008ClKkzxGXCK9sTk/K/grqQxKS4iX9g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00042