UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'UzbqKPt0DWLXcY+t9xMiOWZykOhXjH/J4Bic8v2DhGU=' 
WHERE 
  key_id = 'a98055ad9d2cdd3b969fdd18a45aacc21049fe53d7cbf2fb795bfddada34e481' 
  AND (
    token = 'UzbqKPt0DWLXcY+t9xMiOWZykOhXjH/J4Bic8v2DhGU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026