UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'U8WvtkGgK4ioSWNYHyJ6IhPzR51PK258cHUvKt/Jpao=' 
WHERE 
  key_id = '338c3c34d7c82bb3d76019619f40ad0d1d7253f06c648aa9e02a76acf85278bb' 
  AND (
    token = 'U8WvtkGgK4ioSWNYHyJ6IhPzR51PK258cHUvKt/Jpao=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036