UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Qromtky8ZfTS9C2OXjGud2C0SYJEKJgcAWGIjc9R8fU=' 
WHERE 
  key_id = 'a94f3150b053f4cc191ca9afbff3f495015324950c1824f03d8604d24b3e919d' 
  AND (
    token = 'Qromtky8ZfTS9C2OXjGud2C0SYJEKJgcAWGIjc9R8fU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00017