UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'bNEzk7TbHTEvdE57jQkTJfANHzULWmql2YUwH2GzR8U=' 
WHERE 
  key_id = '01df6ea89bfcb447afc6e757138e61fce4e8a5f054a1a7b336132514e9450cee' 
  AND (
    token = 'bNEzk7TbHTEvdE57jQkTJfANHzULWmql2YUwH2GzR8U=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045