UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wG+wz2QNhKsCDCYzkTajKfJMaTQhxVbqCsrKdvnjt3s=' 
WHERE 
  key_id = '88f765e73376c72814b4c330933a4526f041a6b7b7dc6dcccd56eb395fbc76b6' 
  AND (
    token = 'wG+wz2QNhKsCDCYzkTajKfJMaTQhxVbqCsrKdvnjt3s=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016