UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0aD3jf3HVj1DVK+grcoWH9OrmjcK4itDR7MDnnt61oI=' 
WHERE 
  key_id = 'f103d902e0a7759a11e30d7a4bf539df1c7ab523aaf2787af0ae47f484d7af29' 
  AND (
    token = '0aD3jf3HVj1DVK+grcoWH9OrmjcK4itDR7MDnnt61oI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031