UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'BtzAOSm+A6/i2Sq3laDQiwWzkOKIuzfAD4Hhgx6Pyqg=' 
WHERE 
  key_id = '1718eb5435e690302fe1680b7a3ffcfa0604e21672877a6b7eb7fd2a1648435b' 
  AND (
    token = 'BtzAOSm+A6/i2Sq3laDQiwWzkOKIuzfAD4Hhgx6Pyqg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041